/*
  ******************************************************************************
  * File Name          : FFT.h
  * Description        : This file provides code for the FFT.
  * Author             : GZC
  * Date               : 2021-01-30
  ******************************************************************************
*/
#ifndef __FFT_H_
#define __FFT_H_

#ifdef __cplusplus
 extern "C" {
#endif
/*! include headers */
/*!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#ifdef ARM_MATH_CM4
#include "arm_math.h"  
#include "arm_const_structs.h"
#else
#include <math.h>
typedef float float32_t;
typedef double float64_t;
#endif

#pragma pack(1)
typedef struct 
{
    float32_t amp;
    float32_t pha;/*! note, should be angle, not radians */
}fft_point_t;
#pragma pack()

/*!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*! Public function list */
void FFT_caculate_adc_buff(float32_t* pAdcBuff, uint32_t adcBuffSize, fft_point_t *pResult, uint8_t harmonixNum);
int Down(float x);

#ifdef __cplusplus
}
#endif

#endif
/*! end of the file */
